<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-water-edit" th:object="${sysWater}">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印：</label>
                <div class="col-sm-8">
                    <input type="checkbox" id="state" th:checked="${sysWater.state == 1 ? true : false}">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印文字：</label>
                <div class="col-sm-8">
                    <input name="text" th:value="${sysWater.text}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印字体：</label>
                <div class="col-sm-8">
                    <input name="font" th:value="${sysWater.font}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">字体大小：</label>
                <div class="col-sm-8">
                    <input name="size" th:value="${sysWater.size}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印X位置：</label>
                <div class="col-sm-8">
                    <input name="x" th:field="*{x}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印Y位置：</label>
                <div class="col-sm-8">
                    <input name="y" th:field="*{y}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印宽度：</label>
                <div class="col-sm-8">
                    <input name="width" th:field="*{width}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印高度：</label>
                <div class="col-sm-8">
                    <input name="height" th:field="*{height}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印角度：</label>
                <div class="col-sm-8">
                    <input name="rotate" th:field="*{rotate}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">水印颜色：</label>
                <div class="col-sm-8">
                    <input name="fill" th:field="*{fill}" class="form-control" type="text">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-offset-5 col-sm-10">
                <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/water";
    $("#form-water-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-water-edit').serializeArray();
            var state = $("input[id='state']").is(':checked') == true ? 1 : 0;
            data.push({"name": "state", "value": state});
            $.operate.save(prefix + "/edit", data,function(result) {
                layer.msg(result.msg, {
                    icon: $.modal.icon(0),
                    time: 500,
                    shade: [0.1, '#8F8F8F']
                });
            });
        }
    }
</script>
</body>
</html>